<template>
	<view>
		<view class="">
			<view class="m-h1" style="text-align: center;">
				新增地址
			</view>
			<view class="" @tap="toBack()">
				<image class="nav-margin-back-img" src="../../static/back.png" mode="widthFix"></image>
			</view>
		</view>	
		
		<view class="content nav-margin-top" style="">
			<van-field
			  v-model="value"
			  label="收货人"
			  placeholder="请输入收货人姓名"
			  input-align="right"
			/>
			
			<van-field
			  v-model="value"
			  label="联系方式"
			  placeholder="请输入收货人的电话"
			  input-align="right"
			/>
			<view class="">
				
				<view class="content">
					<pickerAddress @change="change">
						<van-field
						  readonly
						  clickable
						  name="area"
						  :value="value3"
						  label="地区选择"
						  :placeholder="txt"
						  input-align="right"
						/>
					</pickerAddress>
				</view>
			</view>
		
			<van-field
			  v-model="message"
			  rows="1"
			  autosize
			  label="详细地址"
			  type="textarea"
			  placeholder="请输入详细地址（项目具体施工地址）"
			/>
		</view>
		
		
		<view class="o-2-box">
			<view class="a-buttom content">
				<view class="" style="display: flex;justify-content: space-between;">
					<view class="" style="display: flex;position: relative;top: 20rpx; left: 30rpx;">
						<view @tap="isCheck = !isCheck" :class="[isCheck?'a-c-a':'']" class="a-c" style="margin-right: 20rpx;">
						</view>
						<text class="a-defult" style="position: relative;top: 10rpx;margin-right: 264rpx;">设置为默认地址</text>
					</view>
					<view class="">
						<button @tap="toBack()" class="a-btn" style="display: flex;align-items: center;justify-content: center;width: 200rpx;">
							<text class="a-font">保存地址</text>
						</button>
					</view>
				</view>
			</view>
		</view>
	
	</view>
</template>

<script>
	import pickerAddress from '../../components/wangding-pickerAddress/wangding-pickerAddress.vue'
	export default {
		components:{
			pickerAddress
		},
		data() {
			return {
				txt: '选择地址',
				title: 'Hello',
				value3:'',
				isCheck:false
			}
		},
		methods: {
			toBack:function(){
				console.log(1)
				uni.navigateBack({
					delta: 1 //返回上一级页面
				})
			},
			 change(data) {
				 console.log(data)
			    this.value3 = data.data.join('')
			    console.log(data.data.join(''))
			  }
		}
	}
</script>

<style scoped lang="less">
@import url('../../style.less');
@import url('addr.less');
</style>
